﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.effects {
    import flash.display.*;
    import Classes.*;
    import com.greensock.*;

    public class PulsateGlowEffect extends MapResourceEffect {

        private var m_isActive:Boolean;
        private var m_glowColor:uint;
        private var m_glowTimeline:TimelineLite;

        public function PulsateGlowEffect(_arg1:MapResource, _arg2:uint=0xFFAA00){
            var _local3:DisplayObject;
            super(_arg1);
            this.m_isActive = true;
            this.m_glowColor = _arg2;
            if (m_mapResource.getDisplayObject()){
                _local3 = m_mapResource.getDisplayObject();
                this.m_glowTimeline = new TimelineLite({onComplete:this.cleanUp});
                this.m_glowTimeline.insert(TweenMax.to(_local3, 0.5, {
                    glowFilter:{
                        color:_arg2,
                        alpha:1,
                        blurX:8,
                        blurY:8,
                        strength:10
                    },
                    repeat:-1,
                    yoyo:true
                }));
            };
        }
        override public function animate(_arg1:uint):Boolean{
            var _local2:DisplayObject;
            if (!this.m_isActive){
                this.m_glowTimeline.clear();
                this.m_glowTimeline.kill();
                _local2 = m_mapResource.getDisplayObject();
                if (_local2){
                    _local2.filters = [];
                };
            };
            return (this.m_isActive);
        }
        override public function cleanUp():void{
            this.m_isActive = false;
        }

    }
}//package Classes.effects 
